package com.ftdigital.primemovers_operators.fragment;


import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.ftdigital.primemovers_operators.MainActivity;
import com.ftdigital.primemovers_operators.R;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.ViewById;


/**
 * 个人中心
 */
@EFragment(R.layout.fragment_setting)
public class SettingFragment extends BaseFragment {


    @ViewById(R.id.back_btn)
    ImageButton backBtn;

    @ViewById(R.id.toptitle_title)
    TextView topTitle;

    @AfterViews
    @Override
    void initView() {
        backBtn.setVisibility(View.GONE);
        topTitle.setText(getResources().getString(R.string.title_setting));
    }

    @Click({R.id.baseinfo_layout, R.id.clean_cache_layout, R.id.version_update_layout, R.id.day_inventory_layout,
    R.id.oil_reprot_layout, R.id.platform_instroduce_layout, R.id.message_set_layout})
    @Override
    void Click(View view) {
        switch (view.getId()) {
            case R.id.baseinfo_layout:
                MainActivity.getInstance().switchFragment(this, new EditUserInfoFragment_());
                break;
            case R.id.clean_cache_layout:
                MainActivity.getInstance().switchFragment(this, new CleanCacheFragment_());
                break;
            case R.id.version_update_layout:
                MainActivity.getInstance().switchFragment(this, new VersionUpdateFragment_());
                break;
            case R.id.day_inventory_layout:
                MainActivity.getInstance().switchFragment(this, new DayInventoryFragment_());
                break;
            case R.id.oil_reprot_layout:
//                MainActivity.getInstance().switchFragment(this, new OilReportFragment_());
                MainActivity.getInstance().switchFragment(this, new OilReportFragmentRelease_());
                break;
            case R.id.platform_instroduce_layout:
                MainActivity.getInstance().switchFragment(this, new PlatfromIntroduceFragment_());
                break;
            case R.id.message_set_layout:
                MainActivity.getInstance().switchFragment(this, new MegSetFragment_());
                break;
        }
    }
}
